<template>
	<view class="couponSelect">
		<my-coupons @getnum="onChangeNum($event)" type="2" @getCouPon="getCouPonFun($event)"></my-coupons>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				couponNum: 0
			};
		},
		methods: {
			onChangeNum(e) {
				this.couponNum = e.detail
			},
			getCouPonFun(couponData) {
				let pages = getCurrentPages();
				let prePage = pages[pages.length - 2]; // 上一页面
				prePage.$vm.couponData = couponData
				prePage.$vm.couponNum = this.couponNum
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.couponSelect {
		position: relative;
		font-size: 28rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #333333;

		&::before,
		&::after {
			content: '';
			position: fixed;
			z-index: 99;
			top: 0;
			width: 100%;
			height: 20rpx;
			background-color: #FFCC46;
		}

		&::after {
			background-color: #fff;
			border-radius: 40rpx 40rpx 0 0;
		}
	}
</style>
